package Java7_Concurrency_Cookbook.concurrent_custom.custom_atomic_variable;

/**
 * @author lixiangke
 * @date 2017/11/28
 */
public class Sensor1 implements Runnable {
    ParkingCounter counter;

    public Sensor1(ParkingCounter counter) {
        this.counter = counter;
    }

    @Override
    public void run() {
        counter.carIn();
        counter.carIn();
        counter.carIn();
        counter.carIn();
        counter.carOut();
        counter.carOut();
        counter.carOut();
        counter.carIn();
        counter.carIn();
        counter.carIn();
    }
}
